feat(webgl): add texCoord parameter to getFinalColor hook#8706
feat(webgl): add texCoord parameter to getFinalColor hook#8706YuktiNandwana wants to merge 5 commits intoprocessing:dev-2.0from
Conversation
|
Hi @davepagurek ! Just a gentle ping on this. All the unit tests are passing for the new texCoord parameter, but I'm currently blocked on the exact syntax for the p5.strands visual test. Whenever you have a moment, I'd really appreciate a quick pointer on how to properly set up the visual test so I can get this PR finalized and ready for review! |
Continuous ReleaseCDN linkPublished PackagesCommit hash: d717067 Previous deploymentsThis is an automated message. |
test/unit/visual/cases/webgl.js
Outdated
| p5.createCanvas(50, 50, p5.WEBGL); | ||
| const shader = p5.baseColorShader().modify(() => { | ||
| getFinalColor((color) => { | ||
| color = [texCoord[0], texCoord[1], 0, 1]; |
There was a problem hiding this comment.
Right now this is referring to a global which I think will be undefined. I think we should try using the "flat" p5.strands api for tests here, using .begin() and .end() instead of a callback, which looks like this:
p5.js/test/unit/webgl/p5.Shader.js
Lines 2168 to 2176 in 1f0816d
Note that it also passes the p5 instance in as a parameter. In this case we'd add { p5 }, call p5.finalColor.begin(), and then set p5.finalColor.set([p5.finalColor.texCoord, 0, 1]).
|
Hi @davepagurek, thanks so much for the guidance! I've updated the visual test to use the flat API as you suggested. I also found and updated the remaining hook signatures in the framebuffer tests and missing .frag files. |
Resolves #8667
Changes Made
Testing
cc @davepagurek - Could you help verify the correct way to access texCoord in the visual test?